package com.run;

import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import zipkin.server.internal.EnableZipkinServer;
//import zipkin.server.internal.EnableZipkinServer;

@SpringBootApplication
@EnableZipkinServer
public class ZipkinApplication {
    public static void main(String[] args) {
        SpringApplication.run(ZipkinApplication.class, args);
    }

    /*
     *prometheus环境配置(不需要可以忽略）
     * */
    @Bean
    MeterRegistryCustomizer<MeterRegistry> configurer(@Value("$spring.application.name") String applicationName, @Value("spring.profiles.active") String env) {
        return registry -> registry.config().commonTags("application", applicationName).commonTags("env", env);
    }
}
